#include <iostream>
#include <vector>

template <typename E>
void printVector(const std::vector<E> &v)
{
#if 0
    for (const E &i : v)
    {
        std::cout << i << " ";
    }
#else
    for (typename std::vector<E>::const_iterator it = v.begin(); it != v.end(); it++)
    {
        std::cout << *it << std::endl;
    }
#endif
    std::cout << std::endl;
}

int main(int argc, char const *argv[])
{

    std::vector<int> v1{};
    printVector(v1);

    std::vector<int> v2 = {1, 3, 4, 5, 6};
    printVector(v2);

    std::vector<int> v3 = std::vector<int>(v2.begin(), v2.begin() + 3);
    printVector(v3);

    std::vector<int> v4 = std::vector<int>(v3);
    printVector(v4);

    int arr[] = {1, 3, 4, 6, 7, 0, 8, 2};
    std::vector<int> v5 = std::vector<int>(arr, arr + 3);
    printVector(v5);

    std::vector<int> v6 = std::vector<int>({1, 3, 4, 6, 7, 0, 8, 2});
    printVector(v6);

    std::vector<int> v7 = std::vector<int>(10, 8);
    printVector(v7);

    return 0;
}
